﻿using System;
using Abp.AspNetCore.Mvc.Controllers;
using Abp.Web.Models;
using Abp.Web.Mvc.Models;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Mvc;

namespace HCD.Web.MDC.Controllers
{
    /// <summary>
    ///
    /// </summary>
    public class ErrorController : EnterpriseControllerBase
    {
        /// <summary>
        ///
        /// </summary>
        private readonly IErrorInfoBuilder _errorInfoBuilder;
        /// <summary>
        ///
        /// </summary>
        /// <param name="errorInfoBuilder"></param>

        public ErrorController(IErrorInfoBuilder errorInfoBuilder)
        {
            _errorInfoBuilder = errorInfoBuilder;
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ViewResult Index()
        {
            //var exHandlerFeature = HttpContext.Features.Get<IExceptionHandlerFeature>();

            //var exception = exHandlerFeature != null
            //                    ? exHandlerFeature.Error
            //                    : new Exception("Unhandled exception!");

            //return View(
            //    "Error",
            //    new ErrorViewModel(
            //        _errorInfoBuilder.BuildForException(exception),
            //        exception
            //    )
            //);
            return View();
        }
    }
}